package com.captain.special.二叉树;

import com.captain.leetcode.TreeNode;

/**
 * Des:
 *
 * @author XL
 * @Date 2022/4/22 15:04
 */
public class 二叉树的最大深度104 {
    public int maxDepth(TreeNode root) {
        if (root == null) return 0;
        int deepL = maxDepth(root.left);
        int deepR = maxDepth(root.right);
        return Math.max(deepL, deepR) + 1;
    }
}
